﻿using System;
using System.Drawing;
using System.Windows.Forms;

namespace MentalAlchemy.Compounds.Image
{
	public partial class MiniPreviewControl : UserControl
	{
		#region - Public properties. -
		/// <summary>
		/// Caption label.
		/// </summary>
		public Label Caption
		{
			get { return CaptionLabel; }
		}

		/// <summary>
		/// Image to be shown.
		/// </summary>
		public Bitmap Image
		{
			set
			{
				pictureBox1.Image = value;
			}
		}

		/// <summary>
		/// Defines whether close button should be closed.
		/// </summary>
		public bool ShowCloseButton
		{
			set
			{
				CloseBtn.Visible = value;
			}
		}

		/// <summary>
		/// Returns control for the picture box.
		/// </summary>
		public PictureBox Picture
		{
			get { return pictureBox1; }
		}
		#endregion

		#region - Construction. -
		public MiniPreviewControl()
		{
			InitializeComponent();
		} 
		#endregion

		#region - Event handlers. -
		private void button1_Click(object sender, EventArgs e)
		{
			Dispose();
		} 
		#endregion
	}
}
